<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <jsp:include page="/static/common/easyui_header.jsp"/>
    <script type="text/javascript" src="/static/js/recharge.js"></script>
</head>
<body>
<div id="" class="easyui-layout" style="width:1100px;height:800px;">
    <div data-options="region:'north'" style="height:40px;">
        <a class="easyui-linkbutton">会员充值</a>
        <a class="easyui-linkbutton">会员充次</a>
        <a class="easyui-linkbutton">会员充次过期明细</a>
        <input id="keyword" type="easyui-textbox" name="keyword"/>
        <a href="#" class="easyui-linkbutton" iconCls="icon-reload" id="searchMemberByKeyword">搜索</a>
    </div>
    <div data-options="region:'south'" style="height:300px;">
        <div id="recharge_dategrid_toolbar">
            <a href="#" class="easyui-linkbutton" iconCls="icon-reload" data-cmd="reload" >刷新</a>
            <input type="radio" name="lateDays" value="-1">最近一天
            <input type="radio" name="lateDays" value="-3">最近三天
            <input type="radio" name="lateDays" value="-7">最近七天
        </div>
        <div>
            <table id="recharge_datagrid" class="easyui-datagrid"></table>
        </div>


    </div>
    <div data-options="region:'east'" style="width:550px;">
        <p>
            选择类型:
            <input id="recharge_add" type="radio" name="operateType" value="充值" checked>充值
            <input id="recharge_sub" type="radio" name="operateType" value="扣费">扣费
            <input id="recharge_return" type="radio" name="operateType" value="退还">退还
        </p>
        <div>

            <input type="hidden"  id="cache_id"/>
            <form method="post" id="recharge_form">
                <input type="hidden" name="member.id" id="member_id"/>
                <input type="hidden" name="oldAccount"/>
                <div id="money">
                    <p><div id="div_rechargeMoney">
                        充值金额:<input class="easyui-textbox" name="rechargeMoney" id="rechargeMoney" data-options="validType:'number'" required="required" value="0"/>
                    </div></p>
                    <p><div id="div_unrechargeMoney" hidden >
                        扣费金额:<input class="easyui-textbox" name="rechargeMoney" id="unrechargeMoney" data-options="validType:'number'" required="required"/>
                    </div></p>
                    <p><div id="div_returnMoney" hidden >
                        退还金额:<input class="easyui-textbox" name="rechargeMoney" id="returnMoney" data-options="validType:'number'" required="required"/>
                    </div></p>
                    <p><div id="div_giftMoney">
                        赠送金额:<input class="easyui-textbox" name="giftMoney" value="0" id="giftMoney"/>
                    </div></p>
                </div>
                <script>
                    $("#recharge_add").click(function () {
                        $("#div_unrechargeMoney").hide();
                        $("#div_returnMoney").hide();
                        $("#div_rechargeMoney").show();
                        $("#div_giftMoney").show();

                        $("#unrechargeMoney").textbox("disable");
                        $("#returnMoney").textbox("disable");
                        $("#rechargeMoney").textbox("enable");
                        $("#giftMoney").textbox("enable");
                        $("#total").show();
                        $("#save").attr("data-url","/recharge/rechargeMoney");
                    });
                    $("#recharge_sub").click(function () {
                        $("#div_rechargeMoney").hide();
                        $("#div_giftMoney").hide();
                        $("#div_returnMoney").hide();
                        $("#div_unrechargeMoney").show();

                        $("#rechargeMoney").textbox("disable");
                        $("#giftMoney").textbox("disable");
                        $("#returnMoney").textbox("disable");
                        $("#unrechargeMoney").textbox("enable");
                        $("#total").hide();
                        $("#save").attr("data-url","/recharge/unrechargeMoney");
                    });
                    $("#recharge_return").click(function () {
                        $("#div_rechargeMoney").hide();
                        $("#div_giftMoney").hide();
                        $("#div_returnMoney").show();
                        $("#div_unrechargeMoney").hide();

                        $("#rechargeMoney").textbox("disable");
                        $("#giftMoney").textbox("disable");
                        $("#returnMoney").textbox("enable");
                        $("#unrechargeMoney").textbox("disable");
                        $("#total").hide();
                        $("#save").attr("data-url","/recharge/returnMoney");
                    });
                </script>
                <p>
                    支付方式:
                    <input type="radio" name="payType" value="现金" checked>现金
                    <input type="radio" name="payType" value="银行卡">银行卡
                    <input type="radio" name="payType" value="支付宝">支付宝
                    <input type="radio" name="payType" value="微信">微信
                </p>
                <p>
                    充值员工:<input class="easyui-combobox" name="employee.id" id="rechargeEmployee"
                                data-options="valueField:'id',textField:'name',url:'/employee/listAll'" required="required"/>
                </p>
                <p>
                    充值备注:<br>
                <div style="padding-left: 50px">
                <textarea style="width: 200px;height: 100px;" name="remark"></textarea>
                </div>
                </p>
                <p id="total">
                    合计充值:<span id="totalRechargeMoney"></span>
                </p>
                <p>
                    <a id="save" href="#" class="easyui-linkbutton" iconCls="icon-ok" data-cmd="save" data-url="/recharge/rechargeMoney">确定</a>
                </p>
            </form>
        </div>
        <div></div>
        <div></div>
    </div>
    <div data-options="region:'center'" style="padding:5px;">
        <div style="text-align: center; ">
            <img id="img" src="/static/image/001.png" style="padding-top: 50px;width: 120px;height: 120px;border-radius:100%">
        </div>
        <div>会员卡号:<span id="m_carSn" style="color: red"></span></div>
        <div>会员姓名:<span id="m_username" style="color: red"></span></div>
        <div>当前等级:<span id="m_level" style="color: red"></span></div>
        <div>会员生日:<span id="m_birth" style="color: red"></span></div>
        <div>卡片余额:<span id="m_totalAccount" style="color: red"></span></div>
        <div>当前积分:<span id="m_accumulation" style="color: red"></span></div>
        <div>累计消费:<span id="m_consume" style="color: red"></span></div>
        <div>过期时间:<span id="x" style="color: red"></span></div>
    </div>
</div>
</body>
</html>
